<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>FontID</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">FontID()</font></b></p>
<p><b>语法</b></p><blockquote>

FontID = <font color="#006666"><b>FontID</b></font>(#Font)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Returns the unique system identifier of the #Font. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Font</i></td>
<td width="90%"> 
 
The font to use. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the ID of the font. 
This result is sometimes also referred to as a 'Handle'. Take a look at the extra chapter <a href="../reference/handles.html">Handles and Numbers</a> for 
more information. 

 

</blockquote><p><b>示例</b></p><blockquote>



An example of using FontID() in combination with <a href="../gadget/setgadgetfont.html">SetGadgetFont()</a>: 

 

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 222, 130, "FontID()", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    ButtonGadget</font>(0, 10, 10, 200, 30, "Click to change the font...")
    Font1 =<font color="#006666"> LoadFont</font>(<font color="#924B72">#PB_Any</font>, "Arial"  ,  8, <font color="#924B72">#PB_Font_Bold</font>)
    Font2 =<font color="#006666"> LoadFont</font>(<font color="#924B72">#PB_Any</font>, "Verdana", 12, <font color="#924B72">#PB_Font_StrikeOut</font>)
    UsedFont = 1
  <b><font color="#006666">EndIf</font></b>

  <b><font color="#006666">Repeat</font></b>
    Event =<font color="#006666"> WaitWindowEvent</font>()

  <b><font color="#006666">If</font></b> Event = <font color="#924B72">#PB_Event_Gadget</font>
    <b><font color="#006666">If</font></b> <font color="#006666">EventGadget</font>() = 0
      <b><font color="#006666">If</font></b> UsedFont = 1
<font color="#006666">        SetGadgetFont</font>(0,<font color="#006666"> FontID</font>(Font2))
        UsedFont = 2
      <b><font color="#006666">Else</font></b>
<font color="#006666">        SetGadgetFont</font>(0,<font color="#006666"> FontID</font>(Font1))
        UsedFont = 1
      <b><font color="#006666">EndIf</font></b>
    <b><font color="#006666">EndIf</font></b>
  <b><font color="#006666">EndIf</font></b>

  <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="loadfont.html">LoadFont()</a>, 
<a href="../gadget/setgadgetfont.html">SetGadgetFont()</a>, 
<a href="../2ddrawing/drawingfont.html">DrawingFont()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center><a href=index.html>Font Index</a> - <a href=freefont.html>FreeFont()</a> -&gt;



</body></html>